package com.sch.study.pattern;

import java.util.concurrent.BlockingQueue;

/**
 * User: hui_stone
 * Date: 2015/2/20 0020
 * Time: 下午 13:54
 */
public class Produce implements Runnable {

    private BlockingQueue<Food> foods;


    Produce(BlockingQueue<Food> foods) {
        this.foods = foods;
    }

    @Override
    public void run() {
        int i = 0;
        while (true){
            try {
                foods.put(new Food("食品"+i));
                i++;
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}
